Optimal. Leaf size=80 \[ -\frac{a (A b-a B) \log (a \cos (c+d x)+b \sin (c+d x))}{b d \left (a^2+b^2\right )}+\frac{x (A b-a B)}{a^2+b^2}-\frac{B \log (\cos (c+d x))}{b d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.126949, antiderivative size = 80, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.172, Rules used = {3589, 3475, 12, 3531, 3530} \[ -\frac{a (A b-a B) \log (a \cos (c+d x)+b \sin (c+d x))}{b d \left (a^2+b^2\right )}+\frac{x (A b-a B)}{a^2+b^2}-\frac{B \log (\cos (c+d x))}{b d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3589
Rule 3475
Rule 12
Rule 3531
Rule 3530
Rubi steps
\begin{align*} \int \frac{\tan (c+d x) (A+B \tan (c+d x))}{a+b \tan (c+d x)} \, dx &=\frac{\int \frac{(A b-a B) \tan (c+d x)}{a+b \tan (c+d x)} \, dx}{b}+\frac{B \int \tan (c+d x) \, dx}{b}\\ &=-\frac{B \log (\cos (c+d x))}{b d}+\frac{(A b-a B) \int \frac{\tan (c+d x)}{a+b \tan (c+d x)} \, dx}{b}\\ &=\frac{(A b-a B) x}{a^2+b^2}-\frac{B \log (\cos (c+d x))}{b d}-\frac{(a (A b-a B)) \int \frac{b-a \tan (c+d x)}{a+b \tan (c+d x)} \, dx}{b \left (a^2+b^2\right )}\\ &=\frac{(A b-a B) x}{a^2+b^2}-\frac{B \log (\cos (c+d x))}{b d}-\frac{a (A b-a B) \log (a \cos (c+d x)+b \sin (c+d x))}{b \left (a^2+b^2\right ) d}\\ \end{align*}
Mathematica [C] time = 0.155029, size = 98, normalized size = 1.22 \[ \frac{b (a-i b) (A+i B) \log (-\tan (c+d x)+i)+b (a+i b) (A-i B) \log (\tan (c+d x)+i)+2 a (a B-A b) \log (a+b \tan (c+d x))}{2 b d \left (a^2+b^2\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.032, size = 159, normalized size = 2. \begin{align*}{\frac{\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) Aa}{2\,d \left ({a}^{2}+{b}^{2} \right ) }}+{\frac{\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) Bb}{2\,d \left ({a}^{2}+{b}^{2} \right ) }}+{\frac{A\arctan \left ( \tan \left ( dx+c \right ) \right ) b}{d \left ({a}^{2}+{b}^{2} \right ) }}-{\frac{B\arctan \left ( \tan \left ( dx+c \right ) \right ) a}{d \left ({a}^{2}+{b}^{2} \right ) }}-{\frac{a\ln \left ( a+b\tan \left ( dx+c \right ) \right ) A}{d \left ({a}^{2}+{b}^{2} \right ) }}+{\frac{{a}^{2}\ln \left ( a+b\tan \left ( dx+c \right ) \right ) B}{d \left ({a}^{2}+{b}^{2} \right ) b}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.52825, size = 127, normalized size = 1.59 \begin{align*} -\frac{\frac{2 \,{\left (B a - A b\right )}{\left (d x + c\right )}}{a^{2} + b^{2}} - \frac{2 \,{\left (B a^{2} - A a b\right )} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{2} b + b^{3}} - \frac{{\left (A a + B b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.86233, size = 251, normalized size = 3.14 \begin{align*} -\frac{2 \,{\left (B a b - A b^{2}\right )} d x -{\left (B a^{2} - A a b\right )} \log \left (\frac{b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) +{\left (B a^{2} + B b^{2}\right )} \log \left (\frac{1}{\tan \left (d x + c\right )^{2} + 1}\right )}{2 \,{\left (a^{2} b + b^{3}\right )} d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 4.40048, size = 700, normalized size = 8.75 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.21786, size = 128, normalized size = 1.6 \begin{align*} -\frac{\frac{2 \,{\left (B a - A b\right )}{\left (d x + c\right )}}{a^{2} + b^{2}} - \frac{{\left (A a + B b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} - \frac{2 \,{\left (B a^{2} - A a b\right )} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{2} b + b^{3}}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]